package com.cedric.yixianpai.server.config;

import com.cedric.yixianpai.game.interfaces.Card;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan("com.cedric.yixianpai.game.cards")
public class MyConfig {
    public void showScan(){
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MyConfig.class);
        String[] beanNames=applicationContext.getBeanNamesForType(Card.class);
        for (String beanName : beanNames) {
            Object bean = applicationContext.getBean(beanName);
//            System.out.println("Bean名称： " + beanName + ", 类型： " + bean.getClass());
        }
    }
}
